#pragma once

#define SIZE 4096
#define FLUSH_NONE 1     //刷新策略，无缓冲
#define FLUSH_LINE (1<<1)//行缓冲
#define FLUSH_ALL (1<<2) //全缓冲

typedef struct my_FILE
{
    int fileno;
    int flag;
    char buffer[SIZE];//缓冲区
    int end;//记录缓冲区的末尾
}myFILE;

myFILE *my_fopen(const char* path,const char *mode);
int my_fwrite(const char* s, int num, myFILE *stream);
int my_fflush(myFILE* stream);
int my_fclose(myFILE* stream);
